package com.unieagle.exam.http;

import java.util.ArrayList;

import android.text.TextUtils;

import com.unieagle.exam.model.BaseResult;

public class ResultTipHelper {

    public static String parseResult(Object result, Class<? extends BaseResult> clazz){
        String str;
        if(result == null){
            str = "网络请求失败";
        }else if(!clazz.isInstance(result)){
            str = "网络请求失败";
        }else if(!TextUtils.isEmpty(((BaseResult)result).getError())){
            str ="" +((BaseResult)result).getError();
        }else{
            str = null;
        }
        return str;
    }
    
}
